package org.acra.b;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.Log;
import android.util.SparseArray;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import org.acra.ACRA;

public final class b
{
  private static SparseArray a = new SparseArray();
  private static SparseArray b = new SparseArray();
  private static SparseArray c = new SparseArray();
  private static SparseArray d = new SparseArray();
  private static SparseArray e = new SparseArray();
  private static SparseArray f = new SparseArray();
  private static SparseArray g = new SparseArray();
  private static SparseArray h = new SparseArray();
  private static SparseArray i = new SparseArray();
  private static final HashMap j = new HashMap();

  static
  {
    j.put("HARDKEYBOARDHIDDEN_", a);
    j.put("KEYBOARD_", b);
    j.put("KEYBOARDHIDDEN_", c);
    j.put("NAVIGATION_", d);
    j.put("NAVIGATIONHIDDEN_", e);
    j.put("ORIENTATION_", f);
    j.put("SCREENLAYOUT_", g);
    j.put("TOUCHSCREEN_", h);
    j.put("UI_MODE_", i);
    Field[] arrayOfField = Configuration.class.getFields();
    int k = arrayOfField.length;
    for (int m = 0; ; m++)
      if (m < k)
      {
        Field localField = arrayOfField[m];
        if ((Modifier.isStatic(localField.getModifiers())) && (Modifier.isFinal(localField.getModifiers())))
        {
          String str = localField.getName();
          try
          {
            if (str.startsWith("HARDKEYBOARDHIDDEN_"))
              a.put(localField.getInt(null), str);
            else if (str.startsWith("KEYBOARD_"))
              b.put(localField.getInt(null), str);
          }
          catch (IllegalArgumentException localIllegalArgumentException)
          {
            Log.w(ACRA.LOG_TAG, "Error while inspecting device configuration: ", localIllegalArgumentException);
            continue;
            if (str.startsWith("KEYBOARDHIDDEN_"))
              c.put(localField.getInt(null), str);
          }
          catch (IllegalAccessException localIllegalAccessException)
          {
            Log.w(ACRA.LOG_TAG, "Error while inspecting device configuration: ", localIllegalAccessException);
          }
          if (str.startsWith("NAVIGATION_"))
            d.put(localField.getInt(null), str);
          else if (str.startsWith("NAVIGATIONHIDDEN_"))
            e.put(localField.getInt(null), str);
          else if (str.startsWith("ORIENTATION_"))
            f.put(localField.getInt(null), str);
          else if (str.startsWith("SCREENLAYOUT_"))
            g.put(localField.getInt(null), str);
          else if (str.startsWith("TOUCHSCREEN_"))
            h.put(localField.getInt(null), str);
          else if (str.startsWith("UI_MODE_"))
            i.put(localField.getInt(null), str);
        }
      }
      else
      {
        return;
      }
  }

  public static String a(Context paramContext)
  {
    try
    {
      String str = a(paramContext.getResources().getConfiguration());
      return str;
    }
    catch (RuntimeException localRuntimeException)
    {
      Log.w(ACRA.LOG_TAG, "Couldn't retrieve CrashConfiguration for : " + paramContext.getPackageName(), localRuntimeException);
    }
    return "Couldn't retrieve crash config";
  }

  public static String a(Configuration paramConfiguration)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    Field[] arrayOfField = paramConfiguration.getClass().getFields();
    int k = arrayOfField.length;
    for (int m = 0; ; m++)
      if (m < k)
      {
        Field localField = arrayOfField[m];
        try
        {
          if (Modifier.isStatic(localField.getModifiers()))
            continue;
          localStringBuilder.append(localField.getName()).append('=');
          if (localField.getType().equals(Integer.TYPE))
            localStringBuilder.append(a(paramConfiguration, localField));
          while (true)
          {
            localStringBuilder.append('\n');
            break;
            if (localField.get(paramConfiguration) != null)
              localStringBuilder.append(localField.get(paramConfiguration).toString());
          }
        }
        catch (IllegalArgumentException localIllegalArgumentException)
        {
          Log.e(ACRA.LOG_TAG, "Error while inspecting device configuration: ", localIllegalArgumentException);
        }
        catch (IllegalAccessException localIllegalAccessException)
        {
          Log.e(ACRA.LOG_TAG, "Error while inspecting device configuration: ", localIllegalAccessException);
        }
      }
      else
      {
        return localStringBuilder.toString();
      }
  }

  private static String a(Configuration paramConfiguration, Field paramField)
  {
    String str1 = paramField.getName();
    String str2;
    if ((str1.equals("mcc")) || (str1.equals("mnc")))
      str2 = Integer.toString(paramField.getInt(paramConfiguration));
    do
    {
      return str2;
      if (str1.equals("uiMode"))
        return a((SparseArray)j.get("UI_MODE_"), paramField.getInt(paramConfiguration));
      if (str1.equals("screenLayout"))
        return a((SparseArray)j.get("SCREENLAYOUT_"), paramField.getInt(paramConfiguration));
      SparseArray localSparseArray = (SparseArray)j.get(str1.toUpperCase() + '_');
      if (localSparseArray == null)
        return Integer.toString(paramField.getInt(paramConfiguration));
      str2 = (String)localSparseArray.get(paramField.getInt(paramConfiguration));
    }
    while (str2 != null);
    return Integer.toString(paramField.getInt(paramConfiguration));
  }

  private static String a(SparseArray paramSparseArray, int paramInt)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    for (int k = 0; k < paramSparseArray.size(); k++)
    {
      int m = paramSparseArray.keyAt(k);
      if (((String)paramSparseArray.get(m)).endsWith("_MASK"))
      {
        int n = paramInt & m;
        if (n > 0)
        {
          if (localStringBuilder.length() > 0)
            localStringBuilder.append('+');
          localStringBuilder.append((String)paramSparseArray.get(n));
        }
      }
    }
    return localStringBuilder.toString();
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     org.acra.b.b
 * JD-Core Version:    0.6.2
 */